package lipengfei.botaiframework.utils.collection;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.function.Function;

public class ListUtil {


    public static <Before,After> List<Before>  different(List<Before> beforeList, List<After> afterList, CompareMath converter){


        List<Before> beforeListRes= new ArrayList<Before>();
        if(beforeList!=null){
            for(Before before :beforeList){
                boolean flag= false;
                for(After after :afterList){
                    int res= converter.compare(before,after);
                    if(res==0){
                        flag=true;
                    }
                };
                if(!flag){
                    beforeListRes.add(before);
                }
            };
        }
        return  beforeListRes;
    }




}
